<template>
	<el-form label-width="80px">
		<el-form-item label="市场价格">
			<el-input @input="vModel('oprice', $event)" :value="oprice" class="w-25" type="number" placeholder="市场价格"></el-input>
		</el-form-item>
		<el-form-item label="销售价格">
			<el-input @input="vModel('pprice', $event)" :value="pprice" class="w-25" type="number" placeholder="市场价格"></el-input>
		</el-form-item>
		<el-form-item label="成本价格">
			<el-input @input="vModel('cprice', $event)" :value="cprice" class="w-25" type="number" placeholder="市场价格"></el-input>
		</el-form-item>
		<el-form-item label="商品重量">
			<el-input @input="vModel('weight', $event)" :value="weight" class="w-25"  placeholder="商品重量">
				<template slot="append">公斤</template>
			</el-input>
		</el-form-item>
		<el-form-item label="商品体积">
			<el-input @input="vModel('volume', $event)" :value="volume" class="w-25"  placeholder="商品体积">
				<template slot="append">立方米</template>
			</el-input>
		</el-form-item>
	</el-form>
</template>

<script>
	import {mapState, mapMutations} from "vuex";
	
	export default {
		computed: {
			...mapState({
				express:state => state.goodsCreate.express,
				oprice:state => state.goodsCreate.oprice,
				pprice:state => state.goodsCreate.pprice,
				cprice:state => state.goodsCreate.cprice,
				weight:state => state.goodsCreate.weight,
				volume:state => state.goodsCreate.volume,
				})
		},
		
		methods: {
			...mapMutations(['vModelState']),
			//修改表单数据
			vModel(key, value) {
				this.vModelState({key: key,value: value})
			},
		}
	}
</script>

<style>
</style>
